<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>
<%
 String names = (String) request.getSession().getAttribute("name");
List<Map<String, Object>> list=null;
BigDecimal goodnum=new BigDecimal("0.00");
BigDecimal zsq=new BigDecimal("0.00");
String tx=null;
long zuji=0;
if(names!=null){
 String sql = "select a.zsq,a.touxiang,b.goodnum,count(c.userid) zuji from member a,clientwallet b,myfoot c where a.userid=b.userid and a.userid=?";
 String[] params = new String[1];
 params[0] =names; 
 list= db.queryList(sql, params);	
	for (Map<String, Object> m : list) {
		
		tx=(String)m.get("touxiang");
		goodnum=new BigDecimal(m.get("goodnum").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
		zsq=new BigDecimal(m.get("zsq").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
		zuji=(Long)m.get("zuji");		
	}
} 
%>
<script type="text/javascript">
$(document).ready(function() {	
	$("#goodnum").text('<%=goodnum.toPlainString()%>');
	$("#zsq").html('<%=zsq.toPlainString()%>');
	$("#zuji").html('<%=zuji%>');
});




function fun1(){
	con=confirm("您还未登录，如要查看相关信息需先登录，请问现在是否登录？"); //在页面上弹出对话框
	if(con==true){					
		window.location.href="login.jsp";		
	}/* else{
		window.location.reload();
	}	 */
}
<%-- document.getElementById("goodnum").innerHTML('<%=goodnum.toPlainString()%>');   --%>
<%-- document.getElementById("zsq").innerText('<%=zsq.toPlainString()%>');  --%>


function tuichu(){		
	window.location.href='<%=basePath%>layoutServlet';
}
</script>

<div class="p-top  clearfloat">
	<a href="datum.jsp">
		<%if(names==null) {%>
			<div class="tu">
				<img src="img/touxiang.png" />
			</div>
			<a href="login.jsp">请登录</a>
		<%}else{ %>
			<div class="tu">
				<%if(tx==null) {%>
					<img src="img/touxiang.png" />
				<%}else{ %>
					<img src="<%=tx%>" />
				<%} %>
			</div>
			<p class="name" style="font-size:22px"><%=names %></p> 
		<%} %>
	</a>
	<div class="p-bottom p-bottom1 clearfloat">
		<ul class="clearfloat">
			<a href="balance.jsp">
				<li class="box-s"><span class="opa6"></span>
					<p class="bt">我的现金币</p>
					<p class="price" id="goodnum"></p></li>
			</a>
			<a href="balance.jsp">
				<li class="box-s"><span class="opa6"></span>
					<p class="bt">我的积分</p>
					<p class="price" id="zsq"></p></li>
			</a>
			<a href="zuji.jsp">
				<li class="box-s"><span class="opa6"></span>
					<p class="bt">我的足迹</p>
					<p class="price" id="zuji"></p></li>
			</a>
			
		</ul>
	</div>
</div>

<div class="contaniner fixed-contb">
	<section class="self">
		<dl>
			<dt>
			<%if(names==null) {%> 
				<a href="#" onclick="fun1()"><img src="images/self-icon.png" /> <b>全部订单</b>
					<span><img src="images/right.png" /></span>
					</a>
			<%}else{ %>
				<a href="order.jsp"><img src="images/self-icon.png" /> <b>全部订单</b>
					<span><img src="images/right.png" /></span>
				</a>
		 	<%} %>				 
			</dt>
			<dd>
				<ul>
				<%if(names==null) {%>
					<li><a href="#" onclick="fun1()">
						<img src="images/order-icon03.png" /><p>待付款</p>
						</a>
					</li>
					<li><a href="#" onclick="fun1()">
						<img src="images/order-icon01.png" /><p>待发货</p>
						</a>
					</li>
					<li><a href="#" onclick="fun1()">
						<img src="images/order-icon02.png" /><p>待收货</p>
						</a>
					</li>
					<li><a href="#" onclick="fun1()">
						<img src="images/order-icon04.png" /><p>待评价</p>
						</a>
					</li>
				<%}else{ %>
					<li>
					<a href="orderthree.jsp"> 
						<img src="images/order-icon03.png" />
						<p>待付款</p>
					</a></li>
					<li>
					<a href="ordertwo.jsp"> 
						<img src="images/order-icon01.png" />
						<p>待发货</p>
					</a></li>
					<li>
					<a href="orderfour.jsp"> 
						<img src="images/order-icon02.png" />
						<p>待收货</p>
					</a></li>
					<li>
					<a href="go-assess.jsp"> 
						<img src="images/order-icon04.png" />
						<p>待评价</p>
					</a></li>
					<%} %>
				</ul>
			</dd>
		</dl>

		<ul class="self-icon">
			<%if(names==null) {%>
			<li><a href="#" onclick="fun1()"><img src="images/self-icon01.png" />
					<p>个人信息</p> <span><img src="images/right.png" /></span>
			</a>
			</li>
			<li><a href="#" onclick="fun1()"><img
					src="images/self-icon02.png" />
					<p>我的收藏</p> <span><img src="images/right.png" /></span>
			</a>
			</li>
			<li><a href="#" onclick="fun1()"> <img
					src="images/self-icon012.png" />
					<p>消费记录</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="#" onclick="fun1()"><img src="images/self-icon04.png" />
					<p>地址管理</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="#" onclick="fun1()"> <img
					src="images/self-icon011.png" />
					<p>修改密码</p> <span><img src="images/right.png" /></span>
			</a></li>
			<%}else{ %>
			<li><a href="datum.jsp"> <img src="images/self-icon01.png" />
					<p>个人信息</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="mycollect.jsp"> <img
					src="images/self-icon02.png" />
					<p>我的收藏</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="balance.jsp"> <img
					src="images/self-icon012.png" />
					<p>消费记录</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="addres.jsp"> <img src="images/self-icon04.png" />
					<p>地址管理</p> <span><img src="images/right.png" /></span>
			</a></li>
			<li><a href="resetpwd.jsp"> <img
					src="images/self-icon011.png" />
					<p>修改密码</p> <span><img src="images/right.png" /></span>
			</a></li>
			<%} %>
		</ul>
		<ul class="self-icon">
			<%if(names==null) {%>
			<!-- <li><a href="#" onclick="fun1()"> <img src="images/self-icon05.png" />
					<p>我的分销</p> <span><img src="images/right.png" /></span>
			</a></li> -->
			
			<!-- <li><a href="#" onclick="fun1()"> <img src="images/self-icon013.png" />
					<p>账号绑定</p> <span><img src="images/right.png" /></span>
			</a></li> -->
			<%}else{ %>
			<!-- <li><a href="gobuy.jsp"> <img src="images/self-icon05.png" />
					<p>我的分销</p> <span><img src="images/right.png" /></span>
			</a></li> -->
			
			<!-- <li><a href="#"> <img src="images/self-icon013.png" />
					<p>账号绑定</p> <span><img src="images/right.png" /></span>
			</a></li> -->
			<%} %>
		</ul>
		
		<input type="button" value="退出" onclick="tuichu()"/>

	</section>


</div>

<%@ include file="pub/bottom_list41.jsp"%>
